package org.monkey4j.runner;

import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.InitializationError;

/**
 * {@link Runner} implementation which can be used within a JUnit test environment to automatically inject beans to do
 * monkey testing.
 * 
 * @author hillger.t
 */
public class Monkey4jRunner extends Runner {
	private final BlockJUnit4ClassRunner delegatingRunner;

	public Monkey4jRunner(Class<?> testClass) throws InitializationError {
		this.delegatingRunner = new Monkey4jRunnerDelegate(testClass);
	}

	@Override
	public Description getDescription() {
		return this.delegatingRunner.getDescription();
	}

	@Override
	public void run(RunNotifier notifier) {
		this.delegatingRunner.run(notifier);
	}
}
